﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ServiceModel;

namespace LanSunERP
{
    public partial class LanSunBIService : Form
    {

        ServiceHost host;
        public LanSunBIService()
        {
            InitializeComponent();
            this.Load += new EventHandler(LanSunBIService_Load);
            this.FormClosed += new FormClosedEventHandler(Form_Closed);
         }

        void LanSunBIService_Load(object sender, EventArgs e)
        {
            host = new ServiceHost(typeof(ERPBLayerService), new Uri("http://localhost:8002/"));
            host.Open();
        }
        void Form_Closed(object sender, FormClosedEventArgs e)
        {
            host.Close();
        }   
    }
}
